package com.onekbase.demo.spring;

import com.onekbase.demo.spring.bean.SubLifeBean;
import com.onekbase.demo.spring.service.DemoService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringLifeMain {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-ioc-life.xml");
        SubLifeBean bean = context.getBean("lifeBean", SubLifeBean.class);
        System.out.println(bean);
        ((ClassPathXmlApplicationContext) context).registerShutdownHook();
    }
}
